<?php

namespace app\store\validate;

use think\Validate;

class GoodsTagValidate extends Validate
{
    protected $rule = [
        'tag_name' => 'require|max:50',
        'desc' => 'max:255',
        'status' => 'require|in:0,1'
    ];


    protected $message = [
        'id.require' => '非法请求',
        'id.integer' => '非法请求',
        'tag_name.require' => '标签名称不能为空!',
        'desc.max' => '标签描述过长',
        'status.in' => '无效的状态值!',
    ];


    public function sceneSwitch()
    {
        return $this->only(['id','status'])
                    ->append('id', 'require|integer');
    }

    public function sceneEdit()
    {
    	return $this->only(['id','tag_name','desc','status'])
                    ->append('id', 'require|integer');
            
    }   
}